package com.project.bean;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import java.time.LocalDate;
import java.util.List;

@TableName("t_order")
public class OrderBean {
    @TableId(value = "pk_orderId",type = IdType.AUTO)
    private  Integer id;
    @TableField("o_accept")
    private  String accept;
    //订单的发货地址
    @TableField("o_address")
    private  String address;
    //收货人手机号
    @TableField("o_phone")
    private  String phone;
    //下单时间
    @TableField("o_date")
    private LocalDate date=LocalDate.now();
    //订单总价
    @TableField("o_price")
    private  int price;
    @TableField("o_status")
    private String status="未发货";

    @TableField(exist = false)
    private List<OrderInfoBean> infoList;
    //下单用户
    @TableField("fk_userId" )
    private  Integer userId;

    public OrderBean(String accept, String address, String phone, int price) {
        this.accept = accept;
        this.address = address;
        this.phone = phone;
        this.price = price;
    }

    public OrderBean(LocalDate date, String status) {
        this.date = date;
        this.status = status;
    }

    public OrderBean(List<OrderInfoBean> infoList) {
        this.infoList = infoList;
    }

    public String getAccept() {
        return accept;
    }

    public void setAccept(String accept) {
        this.accept = accept;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public OrderBean() {
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public LocalDate getDate() {
        return date;
    }

    public void setDate(LocalDate date) {
        this.date = date;
    }

    public int getPrice() {
        return price;
    }

    public void setPrice(int price) {
        this.price = price;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public Integer getUserId() {
        return userId;
    }

    public void setUserId(Integer userId) {
        this.userId = userId;
    }

    public List<OrderInfoBean> getInfoList() {
        return infoList;
    }

    public void setInfoList(List<OrderInfoBean> infoList) {
        this.infoList = infoList;
    }
}
